package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class CopyDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("power.jpeg");
        FileOutputStream fos = new FileOutputStream("power_cp.jpeg");

        int d;

        long start = System.currentTimeMillis();//计算当前计算机毫秒值
        while((d = fis.read()) != -1){
            fos.write(d);
        }
        long end = System.currentTimeMillis();
        System.out.println("复制完毕");
        System.out.println("所耗时间："+(end-start)+"ms");
        fis.close();
        fos.close();
    }
}
